//
//  LongFeedbackImageCell.m
//  CoachsBook
//
//  Created by huiyong li on 2022/9/1.
//

#import "LongFeedbackImageCell.h"

@implementation LongFeedbackImageCell


- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        [self setSubViews];
    }
    return self;
}

- (void)layoutSubviews
{

    CGFloat height = self.frame.size.height;
    CGFloat width = self.frame.size.width;
    
    self.ImageV.frame = CGRectMake(5, 5, width-10, height-10);
    self.deleteBut.frame = CGRectMake(width-25, -5, 30, 30);

}

- (void)setSubViews
{
    self.ImageV = [[UIImageView alloc]init];
    self.ImageV.layer.cornerRadius = 6;
    self.ImageV.layer.masksToBounds = YES;
    
    self.deleteBut = [[UIButton alloc]init];
    [self.deleteBut setImage:[UIImage imageNamed:@"delete_icon"] forState:UIControlStateNormal];
    
    
    [self.contentView addSubview:self.ImageV];
    [self.contentView addSubview:self.deleteBut];
}


-(void)cellFillWithImage:(UIImage *)image
{
    self.deleteBut.hidden = NO;
    self.ImageV.image = image;
}
-(void)cellFillWithImageUrl:(NSString *)imageurl
{
    self.deleteBut.hidden = YES;
    [self.ImageV sd_setImageWithURL:[NSURL URLWithString:imageurl] placeholderImage:zhanweiimage];
}


@end
